/**
 * 
 */
package org.jenkon.commons.io.filter;

import java.io.File;
import java.io.FileFilter;
import java.io.Serializable;

/**
 * {@link FileFilter} class with implementing to reverse delegating {@link FileFilter}.
 * 
 * @author Jens Konopka
 * 
 */
public class ReverseFileFilter implements FileFilter, Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -8885405923999306070L;
	private final FileFilter filter;

	/**
	 * @param filter delegating {@link FileFilter}
	 */
	public ReverseFileFilter(final FileFilter filter) {
		this.filter = filter;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.io.FileFilter#accept(java.io.File)
	 */
	public boolean accept(final File pathname) {
		return !filter.accept(pathname);
	}

}
